package com.wonders.hisdoctor.station.enums;

import lombok.Getter;

/**
 * Description: 有效范围枚举类
 *
 * @author tong-aj
 * <p>
 * Create: 2021-04-20 10:50
 */

@Getter
public enum EffectiveEnum {

    GLOBAL("1", "全院"),
    DEPT("2", "科室"),
    PERSONAL("3", "个人");

    private String type;

    private String desc;

    EffectiveEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static EffectiveEnum getDescByType(String type) {
        for (EffectiveEnum effectiveEnum : EffectiveEnum.values()) {
            if (type.equals(effectiveEnum.getType())) {
                return effectiveEnum;
            }
        }
        return null;
    }
}
